<template>
  <div class="child">
    <h1>{{ infoStore.count }} total: {{ infoStore.total }}</h1>
    <button @click="updateCount">点击我修改仓库的数据</button>
  </div>
</template>

<script setup lang="ts">
  import useInfoStore from '../../store/modules/info.ts'
  const infoStore = useInfoStore()

  function updateCount() {
    // infoStore.count++

    // 替换
    /* infoStore.$patch({
      count: 100000,
    }) */

    infoStore.updateNum(66, 77)
  }
</script>

<style scoped>
.child {
  width: 200px;
  height: 200px;
  background: yellowgreen;
}
</style>